<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <base href="${ctx }">
<!-- 字符编码 -->
<meta charset="UTF-8" content="">
<!-- IE兼容模式 -->
<meta http-equiv="X-UA-COMPATIBLE" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<script src="${ctx }/styles/BJUI/new/star2/startpic/jquery.js"
	type="text/javascript"></script>
<link href="${ctx }/styles/BJUI/new/star2/startpic/startcss.css"
	rel="stylesheet" type="text/css" />
<!-- 采用高速模式渲染（目前仅有360支持） -->
<meta name="renderer" content="webkit">
<!-- Bootstrap 核心 CSS库 -->
<link href="${ctx }/styles/BJUI/new/css/bootstrap.min.css"
	rel="stylesheet">
<!-- Font-awesome 图标 CSS库 -->
<link href="${ctx }/styles/BJUI/new/css/font-awesome.min.css"
	rel="stylesheet">
<!-- JQuery UI CSS库 -->
<link href="${ctx }/styles/BJUI/new/css/jquery-ui.min.css"
	rel="stylesheet">
<!-- JQuery -->
<script src="${ctx }/styles/BJUI/new/js/jquery-1.10.2.min.js"
	type="text/javascript"></script>
<script src="${ctx }/styles/BJUI/new/js/jquery.unobtrusive-ajax.min.js"
	type="text/javascript"></script>
<!-- JQuery UI -->
<script src="${ctx }/styles/BJUI/new/js/jquery-ui.min.js"
	type="text/javascript"></script>
<!-- 脉动提示插件 -->
<script src="${ctx }/styles/BJUI/new/js/jquery.pulsate.min.js"
	type="text/javascript"></script>
<!-- Bootstrap 核心 JS库 -->
<script src="${ctx }/styles/BJUI/new/js/bootstrap.min.js"
	type="text/javascript"></script>
<!-- 浏览器判断 -->
<script src="${ctx }/styles/BJUI/new/js/Browser.js"
	type="text/javascript"></script>
<!-- 母版页 样式 -->
<link href="${ctx }/styles/BJUI/new/css/carousel.css" rel="stylesheet">
<!-- 评分控件 -->
<link href="${ctx }/styles/BJUI/new/css/star-rating.min.css"
	rel="stylesheet">
<script src="${ctx }/styles/BJUI/new/js/star-rating.min.js"
	type="text/javascript"></script>
 <!-- 评分控件 -->
    <link href="${ctx }/styles/BJUI/new/css/star-rating.min.css" rel="stylesheet">
    <script src="${ctx }/styles/BJUI/new/js/star-rating.min.js"></script>
<link href="${ctx }/styles/BJUI/new/css/style.css" rel="stylesheet">
<link href="${ctx }/styles/BJUI/new/css/leon.css" rel="stylesheet">
<link href="${ctx }/styles/BJUI/new/css/index.css" rel="stylesheet">
<title>点评</title>
</head>
<body>
	<!-- Start: Ajax Tiper -->
	<!-- Start AJAX提示（全局） -->
	<link href="${ctx }/styles/BJUI/new/css/nprogress.css" rel="stylesheet">
	<script src="${ctx }/styles/BJUI/new/js/nprogress.js"
		type="text/javascript"></script>
	<script type="text/javascript">
		var CurrAjaxCount = 0;
		$(document).ready(function() {
			$(document).ajaxStart(function() {
				if (CurrAjaxCount == 0) {
					NProgress.start();
				}
				CurrAjaxCount = CurrAjaxCount + 1;
			}).ajaxStop(function() {
				CurrAjaxCount = CurrAjaxCount - 1;
				if (CurrAjaxCount <= 0) {
					NProgress.done();
				}
			});
		});
	</script>
	<!-- End AJAX提示（全局） -->
	<!-- End: Ajax Tiper -->




	<!-- End: Browser Tiper -->
	<div class="clearfix">
    <div class="carousel-inner" id="mainWindow" style="position: relative;background-color: #f5f5f5">
        <div class="row">
            <div class="col-sm-8 box-40-mb-1" style="margin-top: 3px;background-color: #f5f5f5">
                <span class="label-text">评分：</span>
                <img src="${ctx }/styles/BJUI/new/images/right-skip.png" class="display-right skip-right">
                <div class="rating-container rating-gly-star display-right starla" style="margin-top: 10px;;" data-content="">
                    <div class="rating-stars" data-content="" id="starla1" style="width: 100%;color: #0099CC"></div>
                </div>
                <div class="rating-container rating-gly-star display-right starla" style="margin-top: 10px;;" data-content="">
                    <div class="rating-stars" data-content="" id="starla2" style="width: 100%;color: #0099CC"></div>
                </div>
                <div class="rating-container rating-gly-star display-right starla" style="margin-top: 10px;;" data-content="">
                    <div class="rating-stars" data-content="" id="starla3" style="width: 100%;color: #0099CC"></div>
                </div>
                <div class="rating-container rating-gly-star display-right starla" style="margin-top: 10px;;" data-content="">
                    <div class="rating-stars" data-content="" id="starla4" style="width: 100%;color: #0099CC"></div>
                </div>
                <div class="rating-container rating-gly-star display-right starla" style="margin-top: 10px;;" data-content="">
                    <div class="rating-stars" data-content="" id="starla5" style="width: 100%;color: #0099CC"></div>
                </div>
            </div>
            <div class="col-sm-8" style="background-color: #f5f5f5;width: 100%;height: 100px">
                <textarea name="content" id="content" style="width:100%;height:100px;border: none;margin: 0"
                onfocus="if(this.value=='这里写内容'){this.value='';}"
				onblur="if(this.value==''){this.value='这里写内容';}"
                >这里写内容</textarea>
            </div>
            <div class="col-sm-8"
                 style="position: absolute;margin-top:25px;bottom: 0;left: 0;width: 100%;margin-bottom: 0;padding: 0">
                <a class="a-blue" id="submit" target="_blank" data-toggle="modal" data-target="#StudentModal" tabindex="-1" onclick="onsubim()">
                    <div class="display-right text-center cursor-pointer"
                         style="width:100%;">
                        <span style="line-height: 50px;color: #ffffff">提交</span>
                    </div>
                </a>
            </div>
        </div>
    </div>
</div>
<input id="receiveAccountId" name="receiveAccountId"  value="${receiveAccountId}"
						type="hidden"> <input id="launchAccountId"   value="${launchAccountId}"
						name="launchAccountId"  type="hidden">
	<script src="${ctx }/styles/BJUI/new/js/ddes.js" charset="UTF-8"
		type="text/javascript"></script>

	<script type="text/javascript">
	  var starlas = $(".starla");
   var index;
   $(function(){
       starlas.click(function(){
           console.log(starlas.index(this));
           index = starlas.index(this);
      ra=    5-index;
           for(var i = 0;i<starlas.size();i++){
               if(i < index){
                    $(starlas[i]).children("div").css({width:0});
               }
               if(i >= index){
                   $(starlas[i]).children("div").css({width:'100%'});
               }
           }

       });
   });
		var ra = 5;
		function onsubim() {
			if (ra == 0) {
				alert("请选择星星");
				return;
			}
			var val = $("#content").val();
			if (val== "") {
				alert("请输入内容");
				return;
			}
			var str2=$("#receiveAccountId").val();
				var str1=$("#launchAccountId").val();
			$.ajax({
				data:{"star":ra,"content":val,"usersId":str2,"userId":str1},
				type : "POST",
				dataType : 'json',
				url : "${ctx }/weixinView/commentsubmit",
				error : function(data) {
					alert(JSON.stringify(res));
				},
				success : function(data) {
					if (data['ret'] == 0) {
						alert("提交成功");
							window.location.href = "${ctx }/weixinView/orderDetails?id=${id}";
					} else {
						alert(data['msg'] );
					}
				}
			});

		}

		
		
	
	</script>
	<!-- End:模态框容器 -->
</body>
</html>
